<meta name="viewport" content="width=device-width,initial-scale=1.0"/>
<?php
@$cid=$_GET['cid'];
@$addr_r=$_SERVER['REMOTE_ADDR'];
@$contact=$_POST["usr"];
  echo "文章ID：$cid<br/>";
  echo "留言内容：";
  @$contact=str_replace('?','',$contact);
  @$contact=str_replace('<','',$contact);
  @$contact=str_replace('/','',$contact);
  @$contact=str_replace('>','',$contact);
  # @$contact=system("nodejs load.js '$contact'");
  echo "<br/>";
  if($contact==""||$contact=="***"){echo "结果：<font style='color:#ff0000;'>无效的昵称！</font>";exit;}
  if($contact=="admin"||$contact=="Admin"||$contact=="root"){if($addr_r!="127.0.0.1"){exit;}}
  @$pre_comment=$_POST["content"];
  @$file='content.txt';
  echo "现在是：";
  @$time=system('date +%Y/%m/%d\ %H:%M:%S');
  echo "<!--";
  @$comment=str_replace('<','&lt;',@$pre_comment);
  @$comment=str_replace('>','&gt;',@$comment);
  @$comment=str_replace("\r","",@$comment);
  @$comment=str_replace("\n",'\n',@$comment);
  @$comment=system("node load.js '$comment'");
  echo "-->";
  if($comment==''||$comment=='***'||$comment=='
'){echo "结果：<font style='color:#f00;'>不能上传空信息！</font>";exit;}
  /*
  @$pre_comment=$comment.'\n';
  @$comment=str_replace('<?','',$pre_comment);
  @$pre_comment=str_replace('?>','',$comment);
  @$comment=str_replace('http://','[http:\/\/]',$pre_comment);
  @$pre_comment=str_replace('https://','[https:\/\/]',$comment);
  @$comment=str_replace('\n',"<br/>",$pre_comment);
  */
  @$comment=$comment.'\n';
  @$comment=str_replace('<?','',$comment);
  @$comment=str_replace('?>','',$comment);
  @$comment=str_replace('http://','[http:\/\/]',$comment);
  @$comment=str_replace('https://','[https:\/\/]',$comment);
  @$comment=str_replace('\n',"<br/>",$comment);
  echo "评论内容：$comment<br/>";
  @$content="<comment cid=\"$cid\">"."<contact>$contact</contact><time>$time</time><content>$comment</content></comment>
";
  @file_put_contents($file,$content,FILE_APPEND);
Header('location:msg.php?m=提交成功');
exit;
?>